package day04;

public class GenEx02 {
    public static void main(String[] args) {            //找质数
        int count=0;
        for (int i = 101; i <= 200; i++) {
            boolean flag=true;
            for (int j = 2; j <= i/2+1; j++) {
                for (int k = 2; k <= i/2+1; k++) {
                    if(i==j*k){
                        flag=false;
                        break;
                    }
                }
                if(!flag) break;
            }
            if(flag) {
                count++;
                System.out.print(i+" ");
            }
        }
        System.out.println(count);
    }
}
